package com.keepassex.inputmethod;

import android.content.Context;
import android.util.Log;
import android.view.View;
import android.widget.Button;
import android.widget.RelativeLayout;

public class KeyboardView extends RelativeLayout {
	KeePassExKeyboard keyboard;

	public KeyboardView(Context context) {
		super(context);
		keyboard = (KeePassExKeyboard) context;
		Button btIf = new Button(context);
		btIf.setText("password");
		btIf.setId(1);
		RelativeLayout.LayoutParams lpIf = new RelativeLayout.LayoutParams(100,
				50);
		lpIf.addRule(RelativeLayout.CENTER_HORIZONTAL);

		btIf.setOnClickListener(new OnClickListener() {
			public void onClick(View v) {
				// KeePassExKeyboard.this.onKey("if");
				Log.d("DEBUG", "btIf onClick");
				keyboard.onKey("*******");
			}
		});
		addView(btIf, lpIf);

		Button btWhile = new Button(context);
		btWhile.setText("username");
		RelativeLayout.LayoutParams lpWhile = new RelativeLayout.LayoutParams(
				100, 50);
		lpWhile.addRule(RelativeLayout.BELOW, 1);
		lpWhile.addRule(RelativeLayout.ALIGN_LEFT, 1);

		btWhile.setOnClickListener(new OnClickListener() {
			public void onClick(View v) {
				// KeePassExKeyboard.this.onKey("while");
				Log.d("DEBUG", "btWhile onClick");
				keyboard.onKey("username test");
			}
		});
		addView(btWhile, lpWhile);
	}
}
